package com.brzjomo.embraceofthevoid.init;

import com.brzjomo.embraceofthevoid.EmbraceOfTheVoid;
import com.brzjomo.embraceofthevoid.blocks.entity.VillagerAltarEntity;
import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.util.Identifier;

import java.util.Objects;

public class ModBlockEntityTypes {
    // Block Entity
    public static final BlockEntityType<VillagerAltarEntity> VILLAGER_ALTAR_ENTITY = FabricBlockEntityTypeBuilder.create(VillagerAltarEntity::new, ModBlocks.VILLAGER_ALTAR).build();

    // Block Entity List
    public static final BlockEntityType<?>[] BLOCK_ENTITY_List = {VILLAGER_ALTAR_ENTITY};

    // Block Entity Path
    public static final String VILLAGER_ALTAR_ENTITY_PATH = "villager_altar_entity";

    // Get Path
    public static String getPath(BlockEntityType<?> entityTypeIn) {
        if (entityTypeIn.equals(VILLAGER_ALTAR_ENTITY)) {
            return VILLAGER_ALTAR_ENTITY_PATH;
        } else {
            return null;
        }
    }

    // Get ID
    public static Identifier getId(BlockEntityType<?> entityTypeIn) {
        return new Identifier(EmbraceOfTheVoid.MOD_ID, Objects.requireNonNull(getPath(entityTypeIn)));
    }
}
